package com.jd.mysql.mgr.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class AdminRedirectController extends MultiActionController{
	public ModelAndView welcome(HttpServletRequest request,HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession(true);
		String username = (String) session.getAttribute("userName");
		request.setAttribute("msg", "Hi "+username+",welcome to 360buy.com database management system!");
		return new ModelAndView("welcome");
	}
	public ModelAndView adddatabase(HttpServletRequest request,HttpServletResponse response) throws Exception {
		String machineId = request.getParameter("machineId");
		return new ModelAndView("database/addDatabase","machineId",machineId);
	}
	public ModelAndView addmachine(HttpServletRequest request,HttpServletResponse response) throws Exception {
		return new ModelAndView("machine/addMgrMachine");
	}
	
	public ModelAndView chart(HttpServletRequest request,HttpServletResponse response) throws Exception {
		return new ModelAndView("jfreechart/chart");
	}
	
}
